-
Notifications
You must be signed in to change notification settings - Fork 46
Add support for filtering change types when diffing #303
Add support for filtering change types when diffing #303
Conversation
diff[test] = []int{ | ||
max(passDiff, countDiff), | ||
max(resultsBefore[1], resultsAfter[1]), | ||
if filter.Deleted || filter.Changed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff tool isn't great. FWIW, changes are just:
- Surround whole code-block in the if-statement above
- Add continue if-statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, very helpful.
param = DiffFilterParam{} | ||
for _, char := range filter { | ||
switch char { | ||
case 'A': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment around here as well that this is inspired by git --diff-filter=
, which, BTW, I really like :) I don't think that rename detection is in any way a straightforward thing, or likely to ever be worth doing, but if we do, it should be 'R'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, and Done.
diff[test] = []int{ | ||
max(passDiff, countDiff), | ||
max(resultsBefore[1], resultsAfter[1]), | ||
if filter.Deleted || filter.Changed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, very helpful.
Progresses #301
Uses a git-inspired filtering charset param.
?filter=[A][C][D]
A = Added
C = Changed
D = Deleted